subroutine outresi(mx,bl,x,Cu,acc_Cu,string,snum)
implicit none
    integer mx,bl,i
    integer snum

    real(8) x(-bl:mx+bl),Cu(-bl:mx+bl),acc_Cu(-bl:mx+bl)
    real(8) rNorm1

    character(len=snum) string

    open(100,file=string,status='replace')
    rNorm1=0.d0
    do i=0,mx
        write(100,"(3(2xd20.10))") x(i),dabs(acc_Cu(i)-Cu(i))
        rNorm1=rNorm1+dabs(acc_Cu(i)-Cu(i))
    enddo
    close(100)

    rNorm1=2.d0*rNorm1/dble(mx)
    open(100,file='norm1.dat',status='replace')
        write(100,*) rNorm1
    close(100)

endsubroutine